/**
 * Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.visit.service.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeeplus.core.excel.converter.ExcelOfficeDTOConverter;
import com.jeeplus.core.excel.converter.ExcelUserDTOConverter;
import com.jeeplus.core.query.Query;
import com.jeeplus.core.query.QueryType;
import com.jeeplus.core.service.dto.BaseDTO;
import com.jeeplus.doctor.domain.DoctorInfo;
import com.jeeplus.patient.domain.PatientInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;
import java.util.Date;
/**
 * 就诊记录DTO
 * @author xx
 * @version 2023-12-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class VisitInfoDTO extends BaseDTO {

	private static final long serialVersionUID = 1L;

	        
	/**
     * 就诊记录
     */
	@ExcelProperty("就诊记录") 
	private String visitRecord;
	        
	/**
     * 病人id
     */
    @Query(tableColumn = "a.patient_id", javaField = "patientId", type = QueryType.EQ)
    @ExcelProperty(value = "病人id", converter = ExcelUserDTOConverter.class) 
	private String patientId;
	        
	/**
     * 主治医生
     */
    @Query(tableColumn = "a.doctor_id", javaField = "doctorId", type = QueryType.EQ)
    @ExcelProperty(value = "主治医生", converter = ExcelUserDTOConverter.class) 
	private String doctorId;
	        
	/**
     * 就诊科室
     */
    @ExcelProperty(value = "就诊科室", converter = ExcelOfficeDTOConverter.class) 
	private String departmentId;
	        
	/**
     * 就诊时间
     */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelProperty("就诊时间") 
	private Date visitTime;
	        
	/**
     * 诊断结果
     */
	@ExcelProperty("诊断结果") 
	private String diagnosis;
	        
	/**
     * 处方
     */
	@NotNull(message="处方不能为空")
	@ExcelProperty("处方") 
	private String prescription;

	@TableField(exist = false)
	private PatientInfo patientInfo;
	@TableField(exist = false)
	private DoctorInfo doctorInfo;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelProperty("满意度时间")
	private Date manyiduTime;

}
